from moviepy.editor import *
from rembg import remove
# import cv2

# import numpy as np

inPath = r'E:\songhq\video\car_concatenate.mp4'
picPath = r'E:\songhq\video\font_picture\yishuzi.png'
picOUtPath = r'E:\songhq\video\font_picture\yishuzi_bak.png'
outPath = r'E:\songhq\video\car_concatenate_pic.mp4'

with open(picPath,'rb') as i:
    input_image = i.read()

#移除背景
out_image = remove(input_image)

with open(picOUtPath,'wb') as o:
    o.write(out_image)




# clip = VideoFileClip(inPath)
# # 添加
# logo = ImageClip(picPath)
#
# pic_clip = logo.set_position((800, 50)).set_duration(3)
# final_clip = CompositeVideoClip([clip, pic_clip])
# final_clip.write_videofile(outPath)
